var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(t, e) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(t, e) {
        t.__proto__ = e;
    } || function(t, e) {
        for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]);
    })(t, e);
}, function(t, e) {
    function n() {
        this.constructor = t;
    }
    o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, 
    new n());
}), a = this && this.__decorate || function(t, e, n, o) {
    var i, c = arguments.length, s = c < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, n) : o;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(t, e, n, o); else for (var r = t.length - 1; 0 <= r; r--) (i = t[r]) && (s = (c < 3 ? i(s) : 3 < c ? i(e, n, s) : i(e, n)) || s);
    return 3 < c && s && Object.defineProperty(e, n, s), s;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("ActionBase"), s = cc._decorator, c = s.ccclass, l = s.property, d = function(e) {
    function t() {
        var t = null !== e && e.apply(this, arguments) || this;
        return t.audio = !1, t.originScale = 1, t.scaleList = [], t.durationList = [], t.btns = [], 
        t;
    }
    return i(t, e), t.prototype.doInit = function() {
        this.node.scale = this.originScale, this.btns = this.node.getComponentsInChildren(cc.Button), 
        this.btns.forEach(function(t) {
            return t.enabled = !1;
        });
    }, t.prototype.doActionEnd = function() {
        this.doActionStop(), 0 < this.scaleList.length ? this.node.scale = this.getScale(this.scaleList.length - 1) : this.node.scale = this.originScale, 
        this.btns.forEach(function(t) {
            return t.enabled = !0;
        });
    }, t.prototype.getAction = function() {
        var n = this, o = cc.tween();
        return 0 < this.scaleList.length ? (this.scaleList.forEach(function(t, e) {
            o.to(n.getDuration(e), {
                scale: t
            });
        }), o.call(function() {
            n.node.dispatchEvent(new cc.Event("finished", !0)), n.btns.forEach(function(t) {
                return t.enabled = !0;
            });
        })) : o.to(1, {
            scale: this.originScale
        }).call(function() {
            n.node.dispatchEvent(new cc.Event("finished", !0)), n.btns.forEach(function(t) {
                return t.enabled = !0;
            });
        });
    }, t.prototype.getScale = function(t) {
        return 0 == this.scaleList.length ? this.originScale : t < this.scaleList.length ? this.scaleList[t] : this.scaleList[this.scaleList.length - 1];
    }, t.prototype.getDuration = function(t) {
        return 0 == this.durationList.length ? 1 : t < this.durationList.length ? this.durationList[t] : this.durationList[this.durationList.length - 1];
    }, a([ l ], t.prototype, "audio", void 0), a([ l ], t.prototype, "originScale", void 0), 
    a([ l([ cc.Float ]) ], t.prototype, "scaleList", void 0), a([ l([ cc.Float ]) ], t.prototype, "durationList", void 0), 
    a([ c ], t);
}(r.default);

n.default = d;